#include "quicksort.h"
#include "random.h"
#include <iostream>
#include <sstream>
#include "../stream/inputbufferstream.h"

using namespace std;

int main(int argc, char** argv)
{
	random(argv[1], atoi(argv[2]));
	split_data(argv[1], atoi(argv[2]), atoi(argv[3]));
	
	inputbufferstream is[atoi(argv[3])];
	for(int i=0;i<atoi(argv[3]);i++)
	{
		stringstream ss;
		ss <<i;
		is[i].open_s(ss.str().c_str());
		for(int j = 0;j<atoi(argv[2])/atoi(argv[3]);j++)
		{
			cout<<is[i].read_next()<<endl;
		}
	}

	return 0;
}
